<template>
	<!-- 小纸条/好友列表 -->
	<view class="user-list p-20 flex items-center border-b border-gray-100" hover-class="bg-gray-100" @click="goToChat">
		<image class="user-img mr-20 rounded-full" :src="item.avatarUrl" mode="aspectFill"></image>
		<view class="flex flex-col flex-1">
			<text class="text-30 font-bold mb-10">{{item.username}}</text>

		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: () => ({})
			}
		},
		methods: {
			goToChat() {
				if (this.item.isVerify) {
					uni.navigateTo({
						url: `/pages/paper/friend-verify/index`
					});
				} else {
					uni.navigateTo({
						url: `/pages/paper/chat?username=${this.item.username}`///index?friendId=${this.item.id}
					});
				}
			}
		}
		}
	
</script>

<style lang="scss" scoped>
	// 用户列表
	.user-list {
		.user-img {
			width: 100rpx;
			height: 100rpx;
		}

	
	}
</style>